﻿using MediatR;
using T.Basic.API.Appliction.Command.FuelCostCommand;
using T.Basic.Repository.BasicImpl;
using T.Basic.Repository.BasicInterface;

namespace T.Basic.API.Appliction.CommandHandlers.FuelCostHanders
{
    /// <summary>
    /// 修改油费信息
    /// </summary>
    public class FuelCostUpdateCommandHandler : IRequestHandler<FuelCostUpdateCommand, int>
    {
        private readonly IFuelCostRepository _FuelCostrepository;
        public FuelCostUpdateCommandHandler(IFuelCostRepository fuelCostrepository)
        {
            _FuelCostrepository = fuelCostrepository;
        }

        public async Task<int> Handle(FuelCostUpdateCommand request, CancellationToken cancellationToken)
        {
            return await _FuelCostrepository.UpdateAsync(request);
        }
    }
}
